package com.rainy.upload.interceptor;

import com.rainy.upload.entity.ResultMessage;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.context.annotation.Configuration;

@Aspect
@Configuration
public class MessageInterceptor {

    @Around("execution(* com.rainy.upload..action.*.*(..)) && @annotation(org.springframework.web.bind.annotation.RequestBody)")
    public Object dealMessage(ProceedingJoinPoint joinPoint) throws Throwable {
        return ResultMessage.newInstanceNotErr(joinPoint.proceed());
    }

}
